home *** CD-ROM | disk | FTP | other *** search
/ Acorn Risc Technologies StrongARM CD-ROM / Acorn Risc Technologies StrongARM CD-ROM.iso / ftp / documents / appnotes / 031_045 / 036c / Text
Encoding:
Text File  |  1993-08-02  |  9.8 KB  |  215 lines

  1. 3rd August 1992
  2. -----------------------------------------------------------------------------
  3. Support Group Application Note 
  4. Number: 036
  5. Issue: 4 
  6. Author:
  7. -----------------------------------------------------------------------------
  8.  
  9. Master 128 Welcome Disc"Converter" Program
  10.  
  11. -----------------------------------------------------------------------------
  12. Applicable Hardware: BBC Master 128
  13.  
  14. Related Application Notes:
  15.  
  16.  
  17. -----------------------------------------------------------------------------
  18. Copyright (C) Acorn Computers Limited 1992
  19.  
  20. Every effort has been made to ensure that the information in this leaflet is 
  21. true and correct at the time of printing. However, the products described in
  22. this leaflet are subject to continuous development and improvements and
  23. Acorn Computers Limited reserves the right to change its specifications at
  24. any time. Acorn Computers Limited cannot accept liability for any loss or
  25. damage arising from the use of any information or particulars in this
  26. leaflet. ACORN, ECONET and ARCHIMEDES are trademarks of Acorn Computers
  27. Limited.
  28. -----------------------------------------------------------------------------
  29. Support Group
  30. Acorn Computers Limited
  31. Acorn House
  32. Vision Park
  33. Histon
  34. Cambridge       CB4 4AE
  35. -----------------------------------------------------------------------------
  36.  
  37.  
  38. Some commercial software written for the BBC Model B or B+ may not work on
  39. the Master Series computers because of minor changes in the specification of
  40. the machine or because the software is badly written.  This program attempts
  41. to provide an environment more similar to the Model B computer in order to
  42. overcome some of these problems.
  43.  
  44.  
  45. The changes provided are as follows:
  46.  
  47. a)  Forcing OSHWM to &1900 (some programs assume that PAGE will be at least
  48. this high).
  49.  
  50. b)  Setting MODE 7 (some programs assume this).
  51.  
  52. c)  A simulation of FX20 is provided.  On issuing this command characters
  53. 32-126 (&20-&7E) are reset to their normal patterns, read from 'ROM'
  54. (actually the MOS's private RAM).  All other characters are undefined.
  55.  
  56. In the default state (FX20,0), any attempt to define a character will copy
  57. the corresponding bank of 32 characters into page &C00 and then define the
  58. character, so a maximum of 32 soft characters are available.
  59.  
  60. In FX20,1 state OSHWM is moved up by 1page, and this page is used for
  61. characters &10-&BF; all other characters when defined will be put in page
  62. &C00.
  63.  
  64. In FX20,2 state OSHWM is moved up by 2 pages:
  65.         the 1st page is used for characters &A0-&BF;
  66.         the 2nd page is used for character &C0-&DF.
  67.         All other characters use page &C00.
  68.  
  69. In FX20,3 state OSHWM is moved up by 3 pages:
  70.         the 1st page is used for characters &A0-&BF;
  71.         the 2nd page is used for characters &C0-&DF;
  72.         the 3rd page is used for characters &E0-&FF.
  73.         All other characters use page &C00.
  74.  
  75. In FX20,4 state OSHWM is moved up by 4 pages:
  76.         the 1st page is used for characters &A0-&BF;
  77.         the 2nd page is used for characters &C0-&DF;
  78.         the 3rd page is used for characters &E0-&FF;
  79.         the 4th page is used for characters &20-&3F.
  80.         All other characters use page &C00.
  81.  
  82. In FX20,5 state OSHWM us moved up by 5 pages:
  83.         the 1st page is used for characters &A0-&BF;
  84.         the 2nd page is used for characters &C0-&DF;
  85.         the 3rd page is used for characters &E0-&FF;
  86.         the 4th page is used for characters &20-&3F;
  87.         the 5th page is used for characters &40-&5F.
  88.         All other characters use page &C00.
  89.  
  90. In FX20, <6-255> state OSHWM is moved up by 6 pages:
  91.         the 1st page is used for characters &A0-&BF;
  92.         the 2nd page is used for characters &C0-&DF;
  93.         the 3rd page is used for characters &E0-&FF;
  94.         the 4th page is used for characters &20-&3F;
  95.         the 5th page is used for characters &40-&5F;
  96.         the 6th page is used for characters &60-&7F.
  97.         Characters &80-&9F use page &C00.
  98.  
  99. d)  Some programs attempt to define soft characters by putting data in page
  100. &C00 (or above OSHWM is FX20,n has been issued).
  101.  
  102. The converter attempts to overcome this by looking at the font flags byte
  103. every time a character is printed.  If this indicates that the character is
  104. stored in 'RAM', then the 8 bytes corresponding to that character are copied
  105. over to the MOS's character workspace, where the real soft characters are
  106. stored.  In addition, when a character is defined, the bytes are put in the
  107. page specified by the font page locations, as well as being passed to the
  108. MOS for storage in its workspace.
  109.  
  110. e)  Some programs use the abbreviation '*D.' for '*DISC', '*CO.' for
  111. '*CODE', or '*LI' for '*LINE'.  Using abbreviations in commercial software
  112. is normally considered bad practice, as paged ROMs in higher priority
  113. sockets may interpret the command as one of theirs (eg *DISARM).  In this
  114. case the command '*DUMP", '*CONFIGURE' and '*LIST' have been added to the
  115. operating system and the above abbreviations are mis-interpreted as these. 
  116. The converter intercepts the command line interpreter and converts any
  117. abbreviation of these commands to the full command.
  118.  
  119. f)  On the BBC Model B, OSBYTE 179 is defined to read the primary OSHWM, ie
  120. the value OSHWM would be if no pages were reserved for soft characters.  On
  121. the Master Series, this call has been reused because soft characters do not
  122. move OSHWM up.  The converter sets up this call to return &1900.  The
  123. converter also sets up the normal OSHWM value to <primary HWM>+<FX20 state>.
  124.  
  125. g)  Some programs check the value of INKEY(-256) (or the equivalent OSBYTE)
  126. in order to prevent the software running on inappropriate machines (eg
  127. Electrons).  The converter makes this call return -1, ie the value returned
  128. by OS 1.20.
  129.  
  130. h)  On the first release of the system, the 1770 DFS (version 2.20) does not
  131. return a value of 1 in the accumulator on return from a successful OSFILE
  132. load (ie OSFILE entered with A=&FF).  The converter intercepts OSFILE if the
  133. DFS is the current filing system, and sets A to 1 on exit from this call
  134. (1770 DFS version 2.24 correctly returns A=1).
  135.  
  136. i)  On OS 1.20 locations &E0, &E1 pointed to a 640 x multiplication table in
  137. the MOS RAM.  Some applications software needs a table of this kind for its
  138. own VDU handling routines, and assumes that these locations point there.  On
  139. the Master Series no table of that form exists, and locations &E0, &E1 are
  140. used for other purposes.  The converter provides its own multiplication
  141. table, and on exit from every OSWRCH call points locations &E0, &E1 to it.
  142.  
  143. j)  Some programs assume that the soft key buffer is at &B00, and load soft
  144. key definitions directly there.  The converter intercepts OSRDCH and INKEY,
  145. to checksum page &B00 and if it has changed since the last time, sets up
  146. real soft key definitions corresponding to the contents of page &B00.  Note
  147. that if ANFS is present, programs that poke page &B00 may interfere with
  148. network operations.
  149.  
  150. k)  Some programs write directly to locations &367-&36E, which on OS 1.20
  151. contain the font ROM/RAM flags, and the font page locations.  The programs
  152. do this so they can store soft characters in other pages, eg pages &900,
  153. &A00.  On the Master Series all fonts are stored in the MOS's private RAM,
  154. so these locations have been reused.
  155.  
  156. The converter sets up these locations as they would be on a Model B, having
  157. preserved their original values elsewhere.  Then on entry to OSWRCH it
  158. refers to these locations to see if the character being printed is stored in
  159. 'RAM', and if so, copies the 8 bytes for that character into the MOS's soft
  160. character workspace.  Then before calling OSWRCH it copies the locations
  161. away, restoring the old values for the duration of the call before swapping
  162. them back on exit! l)  On OS 1.20, the TAB(X,Y) vdu sequence has no effect
  163. while in VDU 5 mode.  On the Master Series this command has now been
  164. implemented in this mode, to move the graphics cursor accordingly. 
  165. Unfortunately, some software 'accidentally' issues this sequence while in
  166. VDU 5 mode and relies on it not having any effect.  The converter intercepts
  167. this sequence an suppresses it when in VDU 5 mode.
  168.  
  169. m)  Some programs simulate a reset by calling the reset vector and assume
  170. that the disc filing system will be selected.  On the Master Series the
  171. filing system is normally preserved over BREAK.  The converter issues a
  172. '*DISC' command on every reset.  This can still be overridden by holding
  173. down a key which is recognised by a filing system, eg the space bar selects
  174. the cassette filing system.
  175.  
  176. n)  Some software uses the *TYPE command (resident in the DFS on Model Bs)
  177. to send VDU sequences to the screen (even though this version of *TYPE calls
  178. OSACSI, which messes up sequences containing character 13).  On the Master
  179. Series, the MOS provides a *TYPE command which converts control codes into
  180. GSREAD format (eg |L for character 12), and also allows for the termination
  181. of lines by CR, LF, CRLF or LFCR.
  182.  
  183. The converter provides its own *TYPE command which more closely resembles
  184. the one in DFS 1.20.
  185.  
  186.  
  187. How it works
  188.  
  189. The converter program resides in a bank of sideways RAM.  On the reset
  190. service call (&27), code is copied to &DD00 in the filing system RAM and the
  191. OSCLI, OSBYTE, OSWRCH and OSRDCH vectors are pointed into this code.  On the
  192. vectors claimed call (&0F) the OSFILE vector is intercepted if the new
  193. filing system is the 1770 DFS.
  194.  
  195. Note that because the vectors point into the filing system RAM, a program
  196. which calls OSBYTE from an event routine which is entered during an OSWRCH
  197. call will probably crash the machine, because he filing system RAM will not
  198. be paged in at that time.
  199.  
  200.  
  201. How to load the converter
  202.  
  203. <Cassette>
  204. To install the converter program, wind the Welcome cassette to the
  205. appropriate place, and type     CHAIN "CONVERT" then follow the
  206. instructions.
  207.  
  208. <Disc>
  209. To install the converter program, mount the Welcome disc and type
  210.         CHAIN "CONVERT"
  211. then follow the instructions.
  212.  
  213. The converter will remain installed until you switch off the computer or you
  214. load another image into sideways bank 4.
  215.